
using RobosimAPI.Class;

namespace RobosimAPI
{
	public class Program
	{
		public static void Main(string[] args)
		{
            var builder = WebApplication.CreateBuilder(args);
			builder.Services.AddControllers();
			builder.Services.AddEndpointsApiExplorer();
			builder.Services.AddSwaggerGen();
			var app = builder.Build();
			if (app.Environment.IsDevelopment())
			{
				app.UseSwagger();
				app.UseSwaggerUI();
			}
			//Command.Command.GetThemeList();
			//Command.Command.GetThemeRuleList();
			//Command.Command.GetThemeRuleDetails();
			Config.GetConfig();
			Task.Run(() =>
			{
				while (true)
				{
					Event.GetEventCount();
					Thread.Sleep(120000);
				}
			});
			app.UseHttpsRedirection();
			app.UseAuthorization();
			app.MapControllers();
			app.Run();
		}
	}
}
